using System;
using System.Collections.Generic;
using System.Text;
using Jbe.TestSuite.Infrastructure.Interface.Services;

namespace Jbe.TestSuite.Infrastructure.Shell.Services
{
    public class MessageService : IMessageService
    {
        public void ShowInformation(string message, object details)
        {
            ShowMessage(MessageType.Information, message, details);
        }

        public void ShowWarning(string message, object details)
        {
            ShowMessage(MessageType.Warning, message, details);
        }

        public void ShowError(string message, object details)
        {
            ShowMessage(MessageType.Error, message, details);
        }

        private static void ShowMessage(MessageType type, string message, object details)
        {
            MessageForm form = new MessageForm();
            form.MessageType = type;
            form.Message = message;
            form.Details = details.ToString();
            form.ShowDialog();
            form.Dispose();
        }
    }
}
